package com.tarena.baking.controller;

import com.tarena.baking.mapper.CodeMapper;
import com.tarena.baking.pojo.vo.CodeAdminVO;
import com.tarena.baking.pojo.vo.CodeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/api/code")
public class CodeController {

    @Autowired
    private CodeMapper codeMapper;

    @GetMapping("select")
    public List<CodeVO> getCodeList() {
        return codeMapper.select();
    }

    @GetMapping("selectForAdmin")
    public List<CodeAdminVO> selectForAdmin() {
        return codeMapper.selectForAdmin();
    }
}
